home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / gnulib / gnucdiff / readme < prev    next >
Encoding:
Text File  |  1988-10-13  |  2.2 KB  |  60 lines

  1. This directory contains the GNU DIFF and DIFF3 utilities, version 1.4.
  2. See file COPYING for copying conditions.
  3.  
  4. This version of diff provides all the features of BSD's diff
  5. except the -D output format (insertion of #ifdef's).
  6.  
  7. It has these additional features:
  8.  
  9.    -a    Always treat files as text and compare them line-by-line,
  10.     even if they do not appear to be ASCII.
  11.  
  12.    -B    ignore changes that just insert or delete blank lines.
  13.  
  14.    -C    equivalent to -c -F'^[_a-zA-Z]'.  This is useful for C code
  15.     because it shows which function each change is in.
  16.  
  17.    -F regexp
  18.     in context format, for each unit of differences, show some of
  19.     the last preceding line that matches the specified regexp.
  20.  
  21.    -H    use heuristics to speed handling of large files that
  22.     have numerous scattered small changes.
  23.     
  24.    -I regexp
  25.     ignore changes that just insert or delete lines that
  26.     match the specified regexp.
  27.  
  28.    -N    in directory comparison, if a file is found in only one directory,
  29.     treat it as present but empty in the other directory.
  30.  
  31.    -T    print a tab rather than a space before the text of a line
  32.     in normal or context format.  This causes the alignment
  33.     of tabs in the line to look normal.
  34.  
  35.  
  36. The basic algorithm is described in: 
  37. "An O(ND) Difference Algorithm and its Variations", Eugene Myers,
  38. Algorithmica Vol. 1 No. 2, 1986, p 251.
  39.  
  40.  
  41. Suggested projects for improving GNU DIFF:
  42.  
  43. 1. Implement the option -D:  -DSTRING means generate a merged version of
  44. the two input files containing #ifdef STRING conditionals that would
  45. cause the result of cpp to be one or the other of the files.
  46.  
  47. 2. Handle very large files by not keeping the entire text in core.
  48.  
  49. One way to do this is to scan the files sequentally to compute hash
  50. codes of the lines and put the lines in equivalence classes based only
  51. on hash code.  Then compare the files normally.  This will produce
  52. some false matches.
  53.  
  54. Then scan the two files sequentially again, checking each match to see
  55. whether it is real.  When a match is not real, mark both the
  56. "matching" lines as changed.  Then build an edit script as usual.
  57.  
  58. The output routines would have to be changed to scan the files
  59. sequentially looking for the text to print.
  60.